<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/order.js"></script>
<script language="javascript">
  function onstsubmit()
	{
		$('#expressform').modal('hide');	
		$('#attributeform').submit();
	}
//批量合并订单
function batchmergeorder()
{
 if (confirm("你确认将所选订单批量合并吗?")) {
	var str = selectallpro();
	if (str != false) {
		$.post("/order/ajaxbutton", {"op": "batchjsmergeorder", "str": str},
			function (data) {
				if (data.code == 200) {
					 window.location.href = "/orderlist/orderlist?order_id=" + data.txt + "";
					return;
				}
				if (data.code == 201) {
					alert(data.txt);
					return;
				}

			}, "json");
	}
}
}
</script>
<title>合并订单列表</title>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/orderleft.tpl'}}
<div class="centercontent">
<div class="pageheader notab">
  <h1 class="pagetitle">合并订单列表</h1>
  <span class="pagedesc">只合并十天内的订单</span>
  
  
</div>
<!--pageheader-->
<div id="contentwrapper" class="contentwrapper">
<div id="basicform" class="subcontent">
   <!--搜索栏-->
          <div>
          <div style="float:left">
          
          
       <a href="javascript:void(0)" onClick="jsmergeorder()" class="btn btn2 btn_help"><span>合并订单</span></a>   
       {{if $usrid== '365' || $userid=='133'|| $userid=='295' || $userid=='360'}}
       <a href="javascript:void(0)" onClick="batchmergeorder()" class="btn btn2 btn_help"><span>批量合并订单</span></a>      
      	{{/if}}
           
        	</div>
         <div style="clear: both"></div>

   	
         <div style="clear: both"></div>
         <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
   </div>
      
    <form class="stdform stdform2" method="get" id="search" action="/orderlist/orderlist">
    <input type='hidden' name='if_csv' id='if_csv'>
    <input type='hidden' name='ordersearchID' id='ordersearchID'>

      <div class="tableoptions"> 
    	
      
        	
       

       
  
      &nbsp;&nbsp;
        <select name="shopname" id="shopname"  class="selection select2_group" style="width:150px;" >
        <option value="" >店铺</option>
        {{foreach from=$d_shop item=li key=key}}
              <option value="{{$li.name}}" {{if $shopname==$li.name}} selected{{/if}}>{{$li.name}}</option>
        {{/foreach}}
        </select>
      
          <select name="st" id="searchtype" class="selection " style="width:100px;" >
          <option value="" >配送方式</option>
        <option value="AFN" {{if $status=='AFN'}} selected{{/if}}>AFN</option>
        <option value="MFN" {{if $status=='MFN'}} selected{{/if}}>MFN</option>
  
      </select>        
               
       <select name="ty" id="searchtype" class="selection" style="width:100px;" >
        <option value="1" {{if $ty==1}} selected{{/if}}>订单时间</option>
      </select>
    
       <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       订单号: <input type="text" name="other" id="other" class="width200" value="{{$other}}" placeholder="订单编号" />
       SKU: <input type="text" name="kw" id="kw" class="width200" value="{{$goodsku}}" placeholder="SKU" />
     
                           
&nbsp;
        <button class="btn btn-primary" id="searchbtn">Search</button>
     
      </div>
      
    
    </form>
    <!--搜索栏结束-->
<table cellpadding="0" cellspacing="0" border="0" class="stdtable" style="table-layout: fixed;">
<thead>
  <tr class="lbbt">
    <td width="3%"  bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
    <td width="8%" bgcolor="#FEFFF1">订单编号</td>
    <td width="5%" bgcolor="#FEFFF1">状态\订单属性</td>
    <td width="10%"  bgcolor="#FEFFF1">店铺/客户/负责人</td>
    <td width="10%" bgcolor="#FEFFF1">原金额/订单金额/总价</td>
    <td width="7%" bgcolor="#FEFFF1">国家/国家(英)</td>
    <td  bgcolor="#FEFFF1">地址信息</td>
    <td  bgcolor="#FEFFF1" >订单日期</td>
    <td  bgcolor="#FEFFF1" >运费/交易号</td>
	<td  bgcolor="#FEFFF1" >客户邮箱/Paypal邮箱</td>
    
  </tr>
</thead>
<tbody >

{{foreach from=$newdates item=res key=key}}
	{{foreach from=$res item=li key=dkey}}
  <tr onDblClick="showOrderlistSell({{$li.order_id}},'{{$li.order_sn}}')" title="双击显示商品信息" style="cursor:pointer" bgcolor="{{$li.color}}">
    <td bgcolor="{{$li.color}}"><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.order_id}}" />
    </td>
    <td valign="middle" style="position:relative;" bgcolor="{{$li.color}}">
     <a href="/orderlist/editorder?order_id={{$li.order_id}}"><font color="#6666FF">{{$li.order_sn}}</font></a>
     </td>
    <td valign="middle" bgcolor="{{$li.color}}">
    {{if $li.order_status==1}}新订单{{/if}}
    {{if $li.order_status==2}}已支付{{/if}}
    {{if $li.order_status==7}}<font color="#FF0000">待审查</font>{{/if}}
    
    <br>{{$li.order_source}}</td>
    
    <td style="position:relative;" bgcolor="{{$li.color}}">
   
      <div style="margin-left:2px;">  {{$li.shopname}} （{{$li.shopoper}}）
     <br>{{$li.consignee}}
    </div>
     
      <div class="lbcp">
      </div>
   </td>
    <td valign="middle" bgcolor="{{$li.color}}">{{$li.moneytype}} {{$li.goods_originask}}<br>RMB {{$li.goods_amount}}</td>
    <td valign="middle" bgcolor="{{$li.color}}">{{$li.country}}<br>{{$li.country_cn}}</td>
    <td class="cz" bgcolor="{{$li.color}}">{{$li.province}} {{$li.city}} {{$li.address}} {{$li.address2}} {{$li.zipcode}} {{$li.tel}}</td>
    <td class="cz" bgcolor="{{$li.color}}">{{$li.ordertime}}</td>
   	<td class="cz" bgcolor="{{$li.color}}">{{if $li.shipping_fee=='0.00'}}{{else}}{{$li.shipping_fee}}{{/if}}<br>{{$li.tradeid}}</td>
    	<td class="cz" bgcolor="{{$li.color}}">{{$li.email}}<br>{{$li.paypalmail}}</td>
   
  </tr>
   {{/foreach}}
{{/foreach}}
</tbody>

</table>
</div>
</div>

  
  <!-- 模态框（Modal）显示订单商品信息 -->
  <form  method="post">
  <div class="modal fade" id="showorder" tabindex="-1" role="dialog" aria-labelledby="sshoworder" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sshoworderSN">   </h4>
        </div>
        <div class="modal-body">
         <table cellpadding="0" cellspacing="0" border="0" class="stdtable" style="table-layout: fixed;">
          <tr class="lbbt"><td width="15%" bgcolor="#FEFFF1">商品编号</td><td bgcolor="#FEFFF1" width="20%">商品名称</td><td bgcolor="#FEFFF1">数量</td><td bgcolor="#FEFFF1">价格</td><td bgcolor="#FEFFF1">成本价</td><td bgcolor="#FEFFF1">总价</td><td bgcolor="#FEFFF1">库存</td><td bgcolor="#FEFFF1">仓库</td><td bgcolor="#FEFFF1">仓位</td></tr>
          <tbody id="showorderlistdata"></tbody>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
  </form>
  
  <!-- 模态框（Modal）交运内容 -->
<form action="/order/ajaxbutton?op=saveexpress"  method="post" name="attributeform" id="attributeform" target="_blank">
<input type="hidden" name="type" id="type">
  <div class="modal fade" id="expressform" tabindex="-1" role="dialog" aria-labelledby="sexpressform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sprintform"> 待交运订单编号  </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="100">订单号： </td>
              <td align="left"><textarea name="orderlist" id="orderlistst" cols="10" rows="10"></textarea></td>
            </tr>
          
            <!-- <tr>
              <td>取消交运： </td>
              <td align="left"><input name="isclenr" type="checkbox" value="1">（已经交运成功的订单，想取消交运打勾）</td>
            </tr>-->
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="onstsubmit()"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
 </form>
  <!-- /.modal -->
</body>
</html>